#******************************************************************************
# Makefile.am (xpc/src)
#------------------------------------------------------------------------------
##
# \file       	Makefile.am
# \library    	xpc
# \author     	Chris Ahlstrom
# \date       	2008-02-26
# \update      2013-10-05
# \version    	$Revision$
# \license    	$XPC_SUITE_GPL_LICENSE$
#
#     This makefile provides the skeleton needed to build the XPC library
#     using GNU autotools.
#
#------------------------------------------------------------------------------

#*****************************************************************************
# Packing targets.
#-----------------------------------------------------------------------------

AUTOMAKE_OPTIONS = foreign dist-zip dist-bzip2
MAINTAINERCLEANFILES = Makefile.in Makefile $(AUX_DIST)

#*****************************************************************************
# CLEANFILES includes stuff generated by the coverage/profiling options.
#-----------------------------------------------------------------------------

CLEANFILES = *.gc*

#******************************************************************************
# EXTRA_DIST
#------------------------------------------------------------------------------

EXTRA_DIST =

#*****************************************************************************
# Import version macros from configure.ac
#-----------------------------------------------------------------------------

PACKAGE = @PACKAGE@
VERSION = @VERSION@

XPC_API_MAJOR = @XPC_API_MAJOR@
XPC_API_MINOR = @XPC_API_MINOR@
XPC_API_PATCH = @XPC_API_PATCH@
XPC_API_VERSION = @XPC_API_VERSION@

XPC_LT_CURRENT = @XPC_LT_CURRENT@
XPC_LT_REVISION = @XPC_LT_REVISION@
XPC_LT_AGE = @XPC_LT_AGE@

#******************************************************************************
# Library directory
#------------------------------------------------------------------------------
#
# 		This define is necessary to cause the proper subdirectory to be made
# 		during installation.  'xpclibdir' is defined in the configure.ac
# 		script.
#
# 		However, apparently does not work with libtool.  See 'libdir' below
# 		instead.
#
# 				pkglibdir=$(xpclibdir)
#
#------------------------------------------------------------------------------

prefix = @prefix@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @xpclibdir@
xpclibdir = @xpclibdir@
xpcdocdir = @xpcdocdir@
xpcdoxygendir = @xpcdoxygendir@
xpcincludedir = @xpcincludedir@

#******************************************************************************
# localedir
#------------------------------------------------------------------------------
#
#  'localedir' is the normal system directory for installed localization
#  files.
#
#------------------------------------------------------------------------------

localedir = $(datadir)/locale
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@

#******************************************************************************
# Local directory
#------------------------------------------------------------------------------

top_srcdir = @top_srcdir@
builddir = @abs_top_builddir@

#******************************************************************************
# Libtool version information
#------------------------------------------------------------------------------

version = $(XPC_API_MAJOR):$(XPC_API_MINOR):$(XPC_API_PATCH)

#******************************************************************************
# AM_CPPFLAGS [formerly "INCLUDES"]
#------------------------------------------------------------------------------
#
#		Defines where to look for header files.
#
#			-	If we build from the xpc_suite root directory, then $top_srcdir
#           is "../.."
#			-	If we build from the xpc directory, then it is "..".
#			-	If we enter a directory such as "debug", and do "../configure",
#				then it is "../../.."
#
#		"../include" is where the xpc header files are located, and it must
#		be defined even if $top_srcdir is "../..".  So we need two entries,
#		to handle the two possible build situations.
#
#		By convention, we include the "xpc" subdirectory in the C/C++ #include
#		directives, so it is not needed here.
#
#------------------------------------------------------------------------------

AM_CPPFLAGS = \
 -I$(top_srcdir)/include \
 -I$(top_srcdir)/xpc/include \
 -I../../include

#******************************************************************************
# Building the library
#------------------------------------------------------------------------------
#
# 		We put library files in the src directory.
#
# 		The static library setup is not needed, since libtool also builds the
#		static version.
#
#------------------------------------------------------------------------------

lib_LTLIBRARIES = libxpc.la

libxpc_la_SOURCES =		\
	build_versions.c     \
	cpu.c                \
	errorlogging.c       \
	environment.c        \
	file_functions.c		\
	gettext_support.c    \
	numerics.c				\
	os.c                 \
	options.c    			\
	parse_ini.c 			\
	portable.c				\
	pthreader.c				\
	pthread_attributes.c	\
	syncher.c				\
	test_settings.c		\
	xstrings.c

#******************************************************************************
# LDFLAGS = -version-info 1:0:0
#------------------------------------------------------------------------------

libxpc_la_LDFLAGS =  -version-info $(version)

#******************************************************************************
# uninstall-hook
#------------------------------------------------------------------------------
#
#     We'd like to remove /usr/local/include/xpc-1.0 if it is
#     empty.  However, we don't have a good way to do it yet.
#
#------------------------------------------------------------------------------

uninstall-hook:
	@echo "Note:  you may want to remove $(libdir) manually"

#******************************************************************************
# Makefile.am (xpc/src)
#------------------------------------------------------------------------------
# Local Variables:
# End:
#------------------------------------------------------------------------------
# vim: ts=3 sw=3 noet ft=automake
#------------------------------------------------------------------------------
